import { connect } from "react-redux";
import { Component } from "react";
import {WriterWrapper,WriterItem} from "../style"

class writer extends Component {
    render(){
        const {list} = this.props;
        return <WriterWrapper>
            <a className="span">推荐作者</a>
            {
                list.map((item)=>(
                    <WriterItem key={item.get('id')}>
                        <img className='pic' src={item.get('imgUrl')} ></img>
                        <a className="title">{item.get('title')}</a>
                        <a className="gz">+关注</a>
                        <p className="desc">{item.get('desc')}</p>
                    </WriterItem>
                ))
            }   
        </WriterWrapper>
    }
}

const mapState = (state) => {
    return {
        list:state.get('home').get('writerList')
    }
}

export default connect(mapState)(writer);